#ifndef _ANINODE_H_
#define _ANINODE_H_

//#include "Animation.h"
#include <vector>
using std::vector;

class CAniNode
{
	//friend class CAnimation;
	// Pointer to parent within the node tree
	CAniNode* m_parentNode;

	// Vector to hold all the children in the tree
	vector<CAniNode*> m_vChildVec;

	unsigned int m_uiJointIndex;

public:
	CAniNode(void) : m_parentNode(0){}

	virtual ~CAniNode(void);

	//********************Accessors******************************

	// Return the parent of this node (if it has one)
	CAniNode *GetParentNode(void) {return m_parentNode;}

	// Return the children of this node (if it has any)
	vector<CAniNode*> &GetChildNodes(void) {return m_vChildVec;}

	//***********************************************************

	void AddChildToTree(CAniNode *node)
	{
		if(node != NULL)
		{
			node->m_parentNode = this;
			m_vChildVec.push_back(node);
		}
	}

	void RemoveChildFromTree(CAniNode *node)
	{
		if(node != NULL)
		{
			if(node->m_parentNode != this)
				return;
			for(unsigned int n = 0; n < m_vChildVec.size(); ++n)
			{
				if(node == m_vChildVec[n])
				{
					m_ChildVec.erase(m_vChildVec.begin() + n);
					node->m_parentNode = NULL;
				}
			}
		}
	}


};
#endif //_ANINODE_H_
